package com.flying.pas.security.model;

import java.util.Date;

import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.ServiceField;
import com.flying.framework.annotation.ServiceFieldParam;
import com.flying.framework.data.Data;
import com.flying.framework.data.DataSerializable;
import com.flying.framework.metadata.Meta;

@SuppressWarnings("serial")
@Meta(id="t_role_user",title="", table="t_role_user", primaryKeys={"role_id","user_id"})
public class RoleUser extends Data implements DataSerializable {
	public final static String ENTITY_NAME = "t_role_user";
	
	public final static String CREATE_TIME = "create_time";
	public final static String CREATOR = "creator";
	public final static String ROLE_ID = "role_id";
	public final static String USER_ID = "user_id";
	
	
	@Param(value=CREATE_TIME,   required=false,   maxlength=0,	desc="创建时间" )
	private Date createTime;
	
	@Param(value=CREATOR,   required=false,   maxlength=100,	desc="创建人" )
	private String creator;
	
	@Param(value=ROLE_ID,   required=true,   maxlength=0,	desc="角色ID")
	private Long roleId;
	
	@Param(value=USER_ID,   required=true,   maxlength=0,	desc="用户ID")
	private Long userId;
	
	@ServiceField(serviceId="RoleService:findById", params={@ServiceFieldParam(param=Role.ROLE_ID, value="$"+ROLE_ID)})
	@Param(value="role",  desc="角色" )
	private Role role;

	@ServiceField(serviceId="UserService:findById", params={@ServiceFieldParam(param=User.USER_ID, value="$"+USER_ID)})
	@Param(value="user",  desc="用户" )
	private User user;
	
	public Date getCreateTime() {
		return this.createTime;
	}
	
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	public String getCreator() {
		return this.creator;
	}
	
	public void setCreator(String creator) {
		this.creator = creator;
	}
	
	public Long getRoleId() {
		return this.roleId;
	}
	
	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}
	
	public Long getUserId() {
		return this.userId;
	}
	
	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}
	

}